package cn.bdqn.config;

import cn.bdqn.web.filter.AuthorizationFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean filterRegistrationBean(){
        FilterRegistrationBean filterRegistrationBean=new FilterRegistrationBean();
        filterRegistrationBean.setFilter(new AuthorizationFilter());
        filterRegistrationBean.setName("AuthorizationFilter");
        filterRegistrationBean.addUrlPatterns("/main");
        filterRegistrationBean.setOrder(5);
        return filterRegistrationBean;
    }
}
